fix: distinct READ_ERROR status for non-missing-file read failures - #579
Merged
pradeeban merged 1 commit intoSep 15, 2026
Conversation
read() was reporting FILE_NOT_FOUND for any file I/O error other than FileNotFoundError, e.g. permission errors or reading a directory. This made read_with_status() unreliable for telling callers why a read actually failed. Also removed EMPTY_DATA from the status docstring since nothing in the file ever sets it. Fixes ControlCore-Project#578
Member
|
Thanks, merged. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #578
read()inconcore_base.pywas reportingFILE_NOT_FOUNDfor any file read failure that wasn't actually a missing file, permission errors, trying to read a directory, a file that fails to decode, etc all fell into the generic except and got the same status. This maderead_with_status()unreliable for telling callers why a read actually failed.Changes:
FileNotFoundError) now setlast_read_status = "READ_ERROR"instead ofFILE_NOT_FOUNDread()docstring's status list to match,EMPTY_DATAwas listed but nothing ever set it, so replaced it withREAD_ERRORFileNotFoundErrorfailure, and checked the existinglast_read_statustest still reflects the real set of valuesScope is intentionally narrow, just the Python file based read path and its docstring/tests. No change to ZMQ handling, write(), or other language runtimes.
Verified with:
pytest tests/test_read_status.py tests/test_concore.py -v(all 64 tests pass)